<?php

class FormHyperLink extends FormControl {

	public static $property = array(
		'wbtype',
		'name',
		'caption',
		'x',
		'y',
		'width',
		'height',
		'disabled',
		'align',
		'lines',
		'color',
		'visible'
	);
	
	public function __construct() { 
		parent::__construct(array(
			'wbtype' => 'HyperLink',
			'x' => 0,
			'y' => 0,
			'width' => 100,
			'height' => 30,
			'caption' => 'this is label',
			'center' => true,
			'line' => 1
		));
	}
	

	/**
	 * 컨트롤 그리기 
	 * 
	 * @param WBGraphics $graphics
	 */
	public function displayControl(WBGraphics $g) {
		
		$xstart = $this->getOption('x');
		$ystart = $this->getOption('y');
		$width = $this->getOption('width');
		$height = $this->getOption('height');		
			
		
		$font = ($this['disabled']) ? self::$disabledFont : self::$realFont ;
		if ($this['disabled']) { 
			$font = self::$disabledFont;
		} else if (wbobject('checkWireFrame')->isChecked()) { 
			$font = self::$realFont;
		} else { 
			if ($this->checkStyle('lines')) { 
				$style = FTA_UNDERLINE;
			} else { 
				$style = 0;
			}
			
			$window = ProjectManager::$mainWindow;
			$window->setResource('hyperlinkFont', 'font', array("Tahoma", 8, $value, $style));
			
			$font = $window->getResource('hyperlinkFont');
		}
		
		if ($this['center']) { 
			$style = WBC_CENTER;
		} else { 
			$style = WBC_LEFT;
		}
	
		$g->text($this['caption'], $xstart, $ystart, $width, $height, $font, $style );
	}
	
	
	public function getProperty() { 
		return self::$property;
	}	
}


?>